package com.hongyun.tms.common;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 分页查询
 *
 * @author lipeng
 * @date 2024-05-31
 */
@Data
public class PageDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "当前页码，从1开始")
    private Long startPage = 1L;

    @ApiModelProperty(value = "单页数量，默认20")
    private Long pageSize = 20L;

    public void setPageSize(Long pageSize) {
        if (pageSize == null || pageSize == 0) {
            return;
        }
//        this.pageSize = pageSize > 100 ? 100 : pageSize;
        this.pageSize = pageSize > 500 ? 500 : pageSize;
    }

}
